extends "../cTDP_2/cTDP_2.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "高级牧师"
	lv = 3
	attCoe.atk = 30 / 8.5 * 2 / 3
	attCoe.maxHp = 720 / 112.5 / 3
	addCdSkill("gjms3",7)
	addCdSkill("gjms",5)
	addSkillTxt("耀目圣光：为我方全体治疗(15 * (lv - 3) + 攻击）点血量，超出部分将50%转化为护盾[cd：5秒]")
	addSkillTxt("神圣迅捷：对敌方全体非牧师造成133%魔法伤害，对我方全体牧师攻速增加150%，持续2s[cd:7秒]")

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "gjms3":
		cst("神圣迅捷","000000",position)
		var chas = getAllChas(1)
		for i in chas:
			if i.get("camp") != "牧师":
				hurtChara(i,att.atk * 1.33,Chara.HurtType.MGI,Chara.AtkType.SKILL)
		chas = getAllChas(2)
		for i in chas:
			if i.get("camp") == "牧师":
				i.addBuff(SSXJ.new(1))

	if id == "gjms":
		cst("耀目圣光","000000",position)
		var chas = getAllChas(2)
		if !chas.size():return
		for i in chas:
			var val = 15 * (lv - 3) + att.atk
			if val > (i.att.maxHp - i.att.hp):
				i.changeShield(int((val - i.att.maxHp + i.att.hp) * 0.5))
				val = (i.att.maxHp - i.att.hp)
			healCha(i,val)

class SSXJ:
	extends Buff
	func _init(lv):
		attInit()
		id = "ssxj"
		life = lv * 2
		att.spd = 1.5